<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/login.css">
    <script src="../js/jquery-1.10.1.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/cookie.js"></script>
    <script src="../js/ajax.js"></script>
    <script src="../js/api_2.js"></script>
    <!-- <script src="../js/login.js"></script> -->
    <style>
        .rt {
            color: green;
            font-size: 12px;
        }

        .err {
            color: red;
            font-size: 12px;
        }
    </style>
</head>

<body>
    <div class="header">
        <ul class="header_left">
            <li><span class="iconfont icon-xingxing"></span><a href="javascript:;" class="Collection">收藏鲜花网(hua.com)</a>
            </li>
            <li><span class="iconfont icon-weixin"></span><a href="">关注微信</a></li>
            <li><span class="iconfont icon-shoujichongzhi"></span><a href="https://www.hua.com/mobile/">花礼网app</a></li>
        </ul>
        <ul class="header_right">
            <li class="tips">
                <a href="./login.html">你好,请登录</a>
                <a href="./register.html">注册</a>
            </li>
            <li>|</li>
            <li><a href="https://www.hua.com/help/ordercx/">订单查询</a></li>
            <li>|</li>
            <li><a href="./login.html">我的花礼</a></li>
            <li>|</li>
            <li class="customer_service">
                <a href="https://www.hua.com/help/">客户服务</a>
                <div class="dropdown-menu dropdown-service">
                    <a href="https://www.hua.com/member/payment/balancefill" target="_blank">在线付款</a>
                    <a href="https://www.hua.com/help/" target="_blank">帮助中心</a>
                    <a href="https://www.hua.com/help/afterservice.htm" target="_blank">售后服务</a>
                    <a href="https://www.hua.com/help/sendRange.htm" target="_blank">配送范围</a>
                    <a href="https://www.hua.com/chat/" target="_blank">留言反馈</a>
                </div>
            </li>
            <li>|</li>
            <li class="shopping_cart">
                <a href=""><span class="iconfont icon-qicheqianlian-"></span>购物车</a>
                <div class="dropdown-menu dropdown-cart" id="CartInfo">
                    <div class="empty">您的购物车中没有商品，<a href="/">先去选购吧</a>！</div>
                </div>
            </li>
            <li>|</li>
            <li><a href="">中国领先鲜花速递服务</a></li>
        </ul>
    </div>
    <div class="logo">
        <img src="../images/logo.png" alt="">
        <p>欢迎登录</p>
        <span>未注册，前往<a href="./register.html">注册</a></span>
    </div>
    <div class="boss">
        <div class="boxLogin">
            <form onsubmit="return false">
                <p>
                    <label for="">用户名:</label>
                    <input id="user" type="text">
                    <span id="user_tips"></span>
                </p>
                <p>
                    <label for="">密&emsp;码:</label>
                    <input id="pwd" type="password">
                    <span id="pwd_tips"></span>
                </p>
                <p><input id="btn" type="submit" value="登录"></p>
            </form>
        </div>
    </div>
    <div class="footer-nav">
        <a href="https://www.hua.com/">首页</a> <b>|</b>
        <a href="https://www.hua.com/profile/about.htm" target="_blank">关于我们</a> <b>|</b>
        <a href="https://www.hua.com/profile/media.html" target="_blank">媒体报道</a> <b>|</b>
        <a href="https://www.hua.com/profile/contact.htm" target="_blank">联系方式</a> <b>|</b>
        <a href="https://www.hua.com/qiyetuangou/" target="_blank">企业团购</a> <b>|</b>
        <a href="https://www.hua.com/liansuo/" target="_blank">花店入驻</a><b>|</b>
        <a href="https://www.hua.com/profile/links.htm" target="_blank">友情链接</a> <b>|</b>
        <a href="https://www.hua.com/member/payment/balancefill" target="_blank">在线补款</a> <b>|</b>
        <a class="last-child" href="https://www.hua.com/profile/why_choose_us.htm" target="_blank">为什么选择花礼网</a>
    </div>
    <footer>
        <div>
            <img src="../images/slogan.png" height="50" width="212">
            <img src="../images/100.jpg" height="49" width="150">
            <img src="../images/bico1.jpg" alt="ICP" height="46" width="35">
            <img src="../images/govIcon.gif" title="深圳市市场监督管理局企业主体身份公示" alt="深圳市市场监督管理局企业主体身份公示" width="35" height="49"
                border="0" style="border-width:0px;border:hidden; border:none;">
        </div>
        <p>
            <a href="/profile/ChinaFlowerAssociation.htm" rel="nofollow" target="_blank" title="中国花卉协会会员">中国花卉协会会员</a>
            <a href="/profile/chinaECA.htm" rel="nofollow" target="_blank">中国电子商务协会会员</a> ICP经营许可证：<a>粤B2-20050744</a>
            <b>|</b> <a href="http://beian.miit.gov.cn" rel="nofollow" target="_blank">粤ICP备09171662号</a>
            <span class="ico beian"></span>粤公网安备44030502000373号 Copyright © 2005-2021
        </p>
        <p> <a href="/">www.hua.com</a><span> 深圳市百易信息技术有限公司</span> </p>
    </footer>




</body>

<script>
    var userInp = document.getElementById("user");

    var pwdInp = document.getElementById("pwd");

    var btn = document.getElementById("btn");

    btn.onclick = function () {
        // 用户输入的
        var user = userInp.value;
        var pwd = pwdInp.value;

        if (user && pwd) {
            login({ user, pwd }).then(function (result) {
                var { status, detail } = result;
                if (status) {
                    setCookie("lgc", user, 31);

                    var search = location.search;
                    var returnUrl = search.split('=')[1];
                    if (returnUrl) { //有参数  => 回去
                        location.href = decodeURIComponent(returnUrl)
                    } else {
                        location.href = "./index1.html";
                    }

                } else {
                    alert(detail);
                }
            }).catch(err => {
                throw err;
            })
        }
    }
</script>

</html>